{*
    Login page
    For HuyBDS
    @author: trungdt
*}	
	{if $loggedin == true}
		<p>Xin chào <span class="username">{if $user->firstname != '' }{$user->firstname} {$user->lastname}{else}{$user->username}</span>{/if}
            || &nbsp;<a href="{link action=logout module=loginmodule}" class="logout">Đăng xuất</a>&nbsp;
        </p>
    {else}
        <p><a id="login_link"  href="javascript: void(0);" class="login">Đăng nhập</a>&nbsp;
            <a href="{link action=createuser module=loginmodule}" class="register">Đăng ký</a>&nbsp;&nbsp;<a href="/english" class="english">English</a>&nbsp;
        </p>
        
        <div id="login_form" >
            <div id="status">
                <h1><img src="{$smarty.const.THEME_RELATIVE}images/key.png" align="absmiddle">&nbsp;Đăng nhập</h1>
                <form id="login" >
                    <input type="hidden" name="action" value="login_ajax">
                    <input type="hidden" name="module" value="loginmodule">
                    <input type="hidden" name="ajax_action" value="1">
                    <div class="control" id="usernameControl">
                        <label>
                            <span class="label">Tên&nbsp;đăng&nbsp;nhập</span>
                        </label>
                        <input type="text" value="" name="username" class="text" size=32>
                    </div>
                    <div class="control" id="usernameControl">
                        <label>
                            <span class="label">Mật khẩu</span>
                        </label>
                        <input type="password" value="" name="password" class="text" size=32>
                    </div>
                    <input type="submit" class="login_button" style="float: right;" value="Đăng nhập">
                    <div id="login_error">
                        {if ($smarty.const.SITE_ALLOW_REGISTRATION == 1 && $smarty.const.MAINTENANCE_MODE != 1)}
                            <a class="register" href="{link action=createuser module=loginmodule}">Đăng ký mới</a><br />
                            <a class="lost_password" href="{link action=resetpass module=loginmodule}">Quên mật khẩu</a><br />
                        {/if}
                    </div>
                    <div id="ajax_loading"><img align="absmiddle" src="http://www.bitrepository.com/demo/modal_login/images/spinner.gif">&nbsp;Đang đăng nhập...</div>
                </form>

            </div>

</div>
    <script language="javascript" src="{$smarty.const.THEME_RELATIVE}modules/loginmodule/js/jquery.simplemodal.js"></script>
    <script language="javascript" src="{$smarty.const.THEME_RELATIVE}modules/loginmodule/js/loginpopup.js"></script>
	{/if}